package com.example.floristshop.database;

import org.litepal.annotation.Column;
import org.litepal.crud.LitePalSupport;

public class Record extends LitePalSupport {
    //销售时间
    @Column(nullable = false)
    private long timestamp;
    //数量
    @Column(nullable = false)
    private int num;
    //金额
    @Column(nullable = false)
    private double money;
    //鲜花ID
    @Column(nullable = false)
    private long flower_id;
    //用户ID
    @Column(nullable = false)
    private long user_id;


    //Constructor
    public Record(long timestamp, int num, double money, long flower_id, long user_id) {
        this.timestamp = timestamp;
        this.num = num;
        this.money = money;
        this.flower_id = flower_id;
        this.user_id = user_id;
    }

    public Record(){
        this.timestamp = 0;
        this.num = 0;
        this.money = 0.00;
        this.flower_id = 0;
        this.user_id = 10000;
    }


    //Setters
    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    public void setFlower_id(long flower_id) {
        this.flower_id = flower_id;
    }

    public void setUser_id(long user_id) {
        this.user_id = user_id;
    }


    //Getters
    public long getTimestamp() {
        return timestamp;
    }

    public int getNum() {
        return num;
    }

    public double getMoney() {
        return money;
    }

    public long getFlower_id() {
        return flower_id;
    }

    public long getUser_id() {
        return user_id;
    }
}
